package com.muchfish.reactor.api;

import reactor.core.publisher.Flux;

public class ReactorReduceExample {
    public static void main(String[] args) {
        Flux<Integer> source = Flux.range(1, 5);

        source.reduce(Integer::sum)
                .subscribe(result -> System.out.println("Sum: " + result)); // 输出: Sum: 15
    }
}
